let good_student: string = "bob";//let 变量
const student: string = "bob";//const 常量
let decLiteral: number = 6;
let list: number[] = [1, 2, 3, 4, 5];
let isDone: boolean = false;
const student1: String = "666";
let unusable: void = undefined;
let u: null = null;
let n: undefined = undefined;
let list1: Array<number> = [12, 32, 54, 4];
const no: object = { "name": "徐凯迪", "age": "15", "class": "1604" };


function xy(x: string, y?: string): string {
	//let st: string = x + y;
	//return st;
	return x + y;
}
xy('笑傲江湖', '令狐冲');

function el(a: string, b: string, c?: string) {
	return a + b + c;
}
el('神雕侠侣', '杨过');
el('神雕侠侣', '杨过', '小龙女');

function buildName(firstName: string, lastName: string) {
	return firstName + " " + lastName;
}
let buildName001 = buildName("Bob", 'Tom');

buildName('jack', 'marry');

function add(firstName = 'will', lastName: string) {
	return firstName + " " + lastName;
}
add('花火', '火花');

function buildName005(a: number | string, b: number | string) {
	if (typeof a === "string" && typeof b === "string") {
		return a + b;
	} else if (typeof a === "number" && typeof b === "number") {
		return a + b;
	} else {
		return a.toString() + b.toString();
	}
}
